#include <iostream>
using std::cout;
using std::endl;

class Point{
    Point(int x,int y)
    : _ix(x) 
    , _iy(y) 
    {
        cout <<"Point(int,int)" << endl;
    }
public:
    static Point & getInstance(){
        static Point pt(1,2);
        return pt;
    }

    Point(const Point & rhs)
    : _ix(rhs._ix)
    , _iy(rhs._iy)
    {
        cout << "Point(const Point & )" << endl;
    }

    Point & operator=(const Point & rhs){
        _ix = rhs._ix;
        _iy = rhs._iy;
        cout <<"Point & operator=" << endl;
        return *this;
    }


    void print(){
        cout << "(" << _ix << ","
            << _iy << ")" << endl;
    }

    ~Point(){
        cout << "~Point()" << endl;
    }
private:
    int _ix;
    int _iy;
};

void test0(){
    /* Point pt(1,2); */
    /* Point pt2(3,4); */
    Point & pt = Point::getInstance();
    Point & pt2 = Point::getInstance();
    cout << &pt << endl;
    cout << &pt2 << endl;
}

int main(void){
    test0();
    return 0;
}
